package la.iok.hzsvn.lewin.movie.shopmovie.mapper;

import la.iok.hzsvn.lewin.movie.core.Token;
import la.iok.hzsvn.lewin.movie.core.model.SimpleUser;
import la.iok.hzsvn.lewin.movie.core.shopmovie.param.CouponUseRecordListParam;
import la.iok.hzsvn.lewin.movie.shopmovie.entity.CouponUseRecord;
import la.iok.hzsvn.lewin.mybatis.mapper.BaseMapper;
import la.iok.hzsvn.share.annotations.NotEmpty;
import la.iok.hzsvn.share.annotations.NotNull;
import la.iok.hzsvn.share.annotations.NotNullElement;
import la.iok.hzsvn.share.annotations.Nullable;
import org.apache.ibatis.annotations.Param;
import org.apache.tomcat.jni.User;

import java.util.List;
import java.util.Set;

public interface CouponUseRecordMapper extends BaseMapper<CouponUseRecord> {

    List<CouponUseRecord> listByParam(@NotNull @NotEmpty String order, @NotNull @NotEmpty String orderColumn,
                                      @NotNull CouponUseRecordListParam param,
                                      @Nullable @NotNullElement Set<Long> orgUnitIds, @Nullable Long userId);


    List<CouponUseRecord> SelectRecord(@NotNull @NotEmpty String order, @NotNull @NotEmpty String orderColumn,
                                      @NotNull CouponUseRecordListParam param,
                                      @Nullable @NotNullElement Set<Long> orgUnitIds, @Nullable Long userId);

    /**
     * 确认使用记录。如果状态是未确认(0),则将确认人,确认时间保存并修改状态为已确认(10),根据id进行记录修改,返回修改记录数
     * @param record 使用记录
     * @return 修改记录数.成功时返回1，失败时返回0
     */
    int confirm(CouponUseRecord record);

    CouponUseRecord selectCouponUseRecord(Long carpoolId,Long playerFeeId);

    Long modifyCouponId(Long id,Long couponId,Long userId);

    Long deleteCouponUseRecord(Long id);

}
